package com.wbp.cms.client.customer.domain;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.commons.lang.StringUtils;

import com.wbp.cms.client.common.BaseDO;
import com.wbp.cms.client.util.ReflectionToStringBuilder;
import com.wbp.cms.client.util.ToStringStyle;


/**
 * @Description:
 * @Department:
 * @author andy.lhc
 * @date 2016年3月6日 下午10:09:48
 */
public class CustomerDO extends BaseDO {

  /**
   * 
   */
  private static final long serialVersionUID = -279953940193989720L;

  private Long id;

  private Date createTime;

  private Date updateTime;

  private String userName;

  private String pwd;

  private int type;

  private String image;

  private String nickName;

  private String mobileNumber;

  private Long userId;

  private String recommendUserName;

  private String realName;

  private int gender;

  private String birthday;

  private int cardType = 1; // 身份证

  private String idCard;

  private String email;

  private String address;

  private String telephone;

  private int customerLevel;

  private String customerLevelLogo;

  private String businessLicense;

  private String legalPerson;

  private int version;


  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public Date getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Date createTime) {
    this.createTime = createTime;
  }

  public Date getUpdateTime() {
    return updateTime;
  }

  public void setUpdateTime(Date updateTime) {
    this.updateTime = updateTime;
  }

  public String getUserName() {
    return userName;
  }

  public void setUserName(String userName) {
    this.userName = userName !=null ? userName.trim() : userName ;
  }

  public String getPwd() {
    return pwd;
  }

  public void setPwd(String pwd) {
    this.pwd =  pwd !=null ? pwd.trim() : pwd ;
  }

  public int getType() {
    return type;
  }

  public void setType(int type) {
    this.type = type;
  }

  public String getImage() {
    return image;
  }

  public void setImage(String image) {
    this.image = image;
  }

  public String getNickName() {
    return nickName;
  }

  public void setNickName(String nickName) {
    this.nickName = nickName !=null ? nickName.trim() : nickName ;
  }

  public String getMobileNumber() {
    return mobileNumber;
  }

  public void setMobileNumber(String mobileNumber) {
    this.mobileNumber = mobileNumber !=null ? mobileNumber.trim() : mobileNumber ;
  }

  public Long getUserId() {
    return userId;
  }

  public void setUserId(Long userId) {
    this.userId = userId;
  }

  public String getRecommendUserName() {
    return recommendUserName;
  }

  public void setRecommendUserName(String recommendUserName) {
    this.recommendUserName = recommendUserName;
  }

  public String getRealName() {
    return realName;
  }

  public void setRealName(String realName) {
    this.realName = realName !=null ? realName.trim() : realName ;
  }

  public int getGender() {
    return gender;
  }

  public void setGender(int gender) {
    this.gender = gender;
  }

  public String getBirthday() {
    if(StringUtils.isNotEmpty(this.birthday)){
      SimpleDateFormat sdf =  new SimpleDateFormat("yyyy-MM-dd") ;
      try {
          Date d  = sdf.parse(this.birthday) ;
          this.birthday = sdf.format(d) ;
      } catch (ParseException e) {
        e.printStackTrace();
      }
      
    }
    return birthday;
  }

  public void setBirthday(String birthday) {
    this.birthday = birthday;
  }

  public int getCardType() {
    return cardType;
  }

  public void setCardType(int cardType) {
    this.cardType = cardType;
  }

  public String getIdCard() {
    return idCard;
  }

  public void setIdCard(String idCard) {
    this.idCard = idCard;
  }

  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email !=null ? email.trim() : email ;
  }

  public String getAddress() {
    return address;
  }

  public void setAddress(String address) {
    this.address = address;
  }

  public String getTelephone() {
    return telephone;
  }

  public void setTelephone(String telephone) {
    this.telephone = telephone !=null ? telephone.trim() : telephone ;
  }

  public int getVersion() {
    return version;
  }

  public void setVersion(int version) {
    this.version = version;
  }

  public int getCustomerLevel() {
    return customerLevel;
  }

  public void setCustomerLevel(int customerLevel) {
    this.customerLevel = customerLevel;
  }

  public String getCustomerLevelLogo() {
    return customerLevelLogo;
  }

  public void setCustomerLevelLogo(String customerLevelLogo) {
    this.customerLevelLogo = customerLevelLogo;
  }

  public String getBusinessLicense() {
    return businessLicense;
  }

  public void setBusinessLicense(String businessLicense) {
    this.businessLicense = businessLicense;
  }

  public String getLegalPerson() {
    return legalPerson;
  }

  public void setLegalPerson(String legalPerson) {
    this.legalPerson = legalPerson;
  }


  @Override
  public String toString() {
    return ReflectionToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
  }
}
